# fun = lambda a,b:a+b
# result = fun(5,2)
# print(result)

a = [1,2,3,4,5]
result = map(lambda x:x**3, a)  # 映射
print(result)
lll = list(result)
for i in lll:
    print(i)
asadasd = list(result)

print(list(result))
print(lll)
print(tuple(list(result)))
print(set(list(result)))
print("-"*30)

#  reduce  累积
from functools import reduce
result = reduce(lambda x,y:x*y,a)
print(result)

# filter 过滤
result = filter(lambda x:x%2,a)
print(list(result))



a = [1,2,3,40,5,6,0,6,0,5]  # 12340560605
result = filter(lambda x:x!=0,a)
print(list(result))

result = 0
mul = 1
for i in a[::-1]:
    result = result + i*mul
    mul = mul*10**len(str(i))
print(result)

result = reduce(lambda x,y:x*10**len(str(y))+y,a)
print(result)


asd=[1,2,3,4,5,6,7,8,9,10,1]
asadasdas = list(asd)
aset = set(asadasdas)
tuple2 = tuple(aset)
aset2 = set(asadasdas)
print(aset)
print(aset2)

my_lambda = lambda x: (
    x + 1,
    x + 2,
    x + 3
)

print(my_lambda(5))  # 输出 (6, 7, 8)

# daszcxc = reduce(lambda x: (
#     x + 3,
#     x + 2,
#     x + 1
# ), [1,2,3])
# print(daszcxc)

from functools import reduce



from functools import reduce

def my_func(x, y,z):
    zzz = x * 10 ** len(str(y)) + y
    return zzz

# 示例数据 a
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]

# 使用 reduce 函数调用正常函数
# result = reduce(my_func, (1,2,3))
print(my_func(1,2,3))
